package proto;

import java.awt.Color;


/**
 *
 * @author Bitjaeger
 *
 */
public class Key extends Field {
    private boolean isCollected;

    public Key() {
        isCollected = false;
        color = Color.BLUE;
    }

    /**
    * Overridden method for key-specific action.
    *
    * Collect the key if it hasn't been collected yet.
    */
    @Override
    public void DoAction(Stickman stickman) {
        super.DoAction(stickman);
        if (isCollected == false) {
            isCollected = true;
            stickman.PickUpKey();
        }
    }

}
